package jp.ac.nitech.matlab.najm.server;

public class Cache {

	MetaDataMap mdm; //temporarily 
	
	public Cache(){
		mdm = MetaDataMap.getInstance();
	}
	
	public boolean exist(String target){
		//search cache for target, if yes
		if(mdm.findFile(target)!=null)
			return true;
		return false;
	}
	
	public String getFile(String target){
		return SSetting.getInstance().getSetting("documentRoot")+target;
	}
	
	public void add(String target){
		mdm.addFile(target, "127.0.0.1");
	}
	
	public Object remove(String target){
		mdm.removeFile(target);
		return new Boolean(true);
	}
}
